package cn.neu.leon.util;

public class Percentage {
public static double[] format(double[] per){
	double sum = 0.0;
	for(int i=0;i<per.length;i++)
	{
		sum+=per[i];
	}
	if(0.0 == sum)
		{
			for(int i=0;i<per.length;i++)
				per[i] = 1.0/7.0;
			return per;
		}
	else{
		for(int i=0;i<per.length;i++)
		{
			per[i]/=sum;
		}
		return per;
	}
}

}
